#include<bits/stdc++.h>
using namespace std;
long long n,mina=0x3f3f3f,s=0,d=0,ls=0;
int a[100005];
int c[100005];
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>a[i];
    for(int i=0;i<n;i++)
    {
        c[a[i]]++;
    }
    for(int i=0;i<100005;i++)
    {
        if(c[i]!=0)
        {
            s=s+c[i];
            if(c[i]>=ls)
                s=s-ls;
            else
                s=s-c[i];
            ls=c[i];
        }
    }
    cout<<s;
    fclose(stdin);
    fclose(stdout);
    return 0;
}
